# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=py3-rdflib
_pyname=rdflib
pkgver=7.0.0
pkgrel=1
pkgdesc="A Python library for working with RDF, a simple yet powerful language for representing information"
url="https://rdflib.readthedocs.org/"
arch="noarch"
license="BSD-3-Clause"
depends="
	py3-isodate
	py3-parsing
	"
makedepends="
	py3-gpep517
	py3-installer
	py3-poetry-core
	"
checkdepends="
	py3-doctest-ignore-unicode
	py3-html5lib
	py3-pytest
	py3-pytest-cov
	py3-requests
	py3-sparqlwrapper
	"
subpackages="$pkgname-pyc"
source="https://github.com/RDFLib/rdflib/archive/refs/tags/$pkgver/rdflib-$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	case "$CARCH" in
	armhf|armv7|x86)
		_skip_hash_test="--deselect=test/test_extras/test_infixowl/test_restriction.py::test_restriction_str_and_hash"
		;;
	esac
	python3 -m venv --clear --without-pip --system-site-packages test-env
	test-env/bin/python3 -m installer .dist/*.whl
	# exclude failing test
	# https://github.com/RDFLib/rdflib/issues/2748
	test-env/bin/python3 -m pytest \
		--ignore="test/test_so_69984830.py" \
		--ignore="test/test_misc/test_plugins.py" \
		--deselect="test/test_misc/test_parse_file_guess_format.py" \
		$_skip_hash_test
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
176192bd2ce8a400e661ced2e21e3dd35783fa1c6c8390f6dee4ac61ca63da5d3a50df3d287f47783631da12452ca3ec92ad06050417029396fe8b3ab0182041  rdflib-7.0.0.tar.gz
"
